package collections.map;

import java.util.HashMap;

/**
 * @Author: ycy
 * @CreateDate: 2020/9/7 14:37
 */
public class StaticMap {

  public static class StaticMapHolder {
    static StaticMap staticMap = new StaticMap();
  }

  private static HashMap hashMap = new HashMap();

  static {
    refresh();
  }

  private static void refresh() {
    HashMap temphashMap = new HashMap();
    temphashMap.put("1", "2");
    hashMap = temphashMap;
  }

  public static StaticMap getInstance() {
    return StaticMapHolder.staticMap;
  }

  public static void main(String[] args) {
    Object a = new Object();
    a = null;
  }

}
